package com.nhimeye.domain;

import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.springframework.roo.addon.equals.RooEquals;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.jsf.model.RooUploadedFile;
import org.springframework.roo.addon.serializable.RooSerializable;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaEntity
@RooEquals
@RooSerializable
public class TemplateVersion {

    @NotNull
    @Size(max = 25)
    private String name;

    @Size(max = 250)
    private String description;

    @RooUploadedFile(contentType = "text/html")
    @Lob
    private byte[] templateText;

    @ManyToOne
    private Template template;

    @ManyToOne
    private Template spaceTemplate;

    @NotNull
    private int versionNumber;
}
